package boc.sx.gateway.convertor;

import boc.sx.gateway.util.Xml2MapUtil;
import com.alibaba.fastjson.JSON;

import java.util.Map;

public class XmlToJsonConvertor implements IBaseConvertor{

    @Override
    public boolean support(String from, String to) {
        return false;
    }

    @Override
    public String convert(String target) {
        Xml2MapUtil xml2MapUtil = new Xml2MapUtil();
        Map map = xml2MapUtil.multilayerXmlToMap(target);
        String json = JSON.toJSONString(map);
        return json;
    }
}
